<?php
// this is the standard template data
$templateData = array(
    'title'             => $this->title,
    'resourceUri'       => $this->resourceUri,
    'description'       => $this->description,
    'descriptionHelper' => $this->descriptionHelper,
    'options'           => $this->options
);

$nature = isset($this->description['http://lod2.eu/schema/deliverableNature'][0]['value'])
        ? $this->description['http://lod2.eu/schema/deliverableNature'][0]['value']
        : null;

$leader = isset($this->description['http://lod2.eu/schema/leadPartner'][0]['value'])
        ? $this->description['http://lod2.eu/schema/leadPartner'][0]['value']
        : null;

$workPackage = isset($this->description['http://lod2.eu/schema/wp'][0]['value']) 
             ? $this->description['http://lod2.eu/schema/wp'][0]['value'] 
             : null;

$link = isset($this->description['http://www.w3.org/2000/01/rdf-schema#seeAlso'][0]['value']) 
      ? $this->description['http://www.w3.org/2000/01/rdf-schema#seeAlso'][0]['value'] 
      : null;
?>

<div class="maincontent">
    <div class="section deliverable">
        <h3><?php echo $this->title ?></h3>
        <div class="section-content">
            <?php echo $this->partial('lod2/content.phtml', $templateData); ?>
            
            <?php if ($workPackage): ?><div>In workpackage: <a href="<?php echo $this->url($workPackage); ?>"><?php 
                echo $this->descriptionHelper->getTitle($workPackage); 
            ?></a></div><?php endif; ?>
            
            <?php if ($leader): ?><div>Leading partner: <a href="<?php echo $this->url($leader); ?>"><?php 
                echo $this->descriptionHelper->getTitle($leader); 
            ?></a></div><?php endif; ?>
            
            <?php if (isset($this->description['http://lod2.eu/schema/deliveryDate'][0]['value'])): ?><div>Delivery date: <?php
                echo $this->date($this->description['http://lod2.eu/schema/deliveryDate'][0]['value'], 'j F Y');
            ?></div><?php endif; ?>
            <?php if ($nature): ?><div>Delivarable nature: <?php echo $nature; ?></div><?php endif; ?>
            <?php if ($link): ?><div>Download: <a href="<?php echo $link; ?>"><?php echo $link; ?></a></div><?php endif; ?>
        </div>
    </div>
</div>